﻿@using csharp_rentals_415.Models;
@model csharp_rentals_415.Models.HomeIndexVm
@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>@Model.Greeting</h1>

   @Html.Partial("Weather", Model)

    <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
    <p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>

<div class="row">
    <div class="col-md-4">
        <h2>All Properties:</h2>
        <ul>
            @foreach (var r in Model.Properties)
            {
                <div>@Html.ActionLink(r.Address, "Edit", "Home", new { id = r.UnitId }, new { @class = "btn btn-primary btn-xs" })  - @r.Realtor</div>
            }
        </ul>
    </div>

    <div class="col-md-4">
        
        <h2>All Rentals:</h2>
        <ul>
            @foreach (var r in Model.Properties.OfType<Rental>())
            {
                <div>@Html.ActionLink(r.Address, "Edit", "Home", new { id = r.UnitId }, new { @class = "btn btn-primary btn-xs" })  - @r.Realtor</div>
                <div>Monthly Rent: @r.RentAmount</div>
            }
        </ul>
    </div>

    <div class="col-md-4">
        <h2>All Condos</h2>
        <ul>
            @foreach (var r in Model.Properties.OfType<Condo>())
            {
                <div>@Html.ActionLink(r.Address, "Edit", "Home", new { id = r.UnitId }, new { @class = "btn btn-primary btn-xs" })  - @r.Realtor</div>
                <div>Cost: @r.PurchaseAmount</div>
            }
        </ul>
     </div>
</div>